//
//  RHServiceCell.m
//  RuiHeAppApp
//
//  Created by Yan Chen on 2023/10/30.
//

#import "RHServiceCell.h"
@interface RHServiceCell()


@end
@implementation RHServiceCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if(self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]){
        [self setupUI];
    }
    return self;
}


-(void)setupUI
{
    self.contentView.backgroundColor = CFTabViewBgColor;
    kWeakSelf;
    
    UIView *bgView = kView;
    [bgView rounded:8 width:1 color:kBorderColor];
    bgView.backgroundColor = [UIColor whiteColor];
    [self.contentView addSubview:bgView];
    [bgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.insets(UIEdgeInsetsMake(8, 15, 8, 15));
    }];
    
    _titleLab = [[QMUILabel alloc]init];
    _titleLab.text = @"Cell No: 1";
    _titleLab.font = [UIFont systemFontOfSize:16];
    _titleLab.textAlignment = NSTextAlignmentLeft;
    _titleLab.textColor = kCOLOR_HEX(@"3F4443");
    [bgView addSubview:_titleLab];
    
    _icon = [[UIImageView alloc]init];
    [bgView addSubview:_icon];
    
    UIImageView *arrowImg = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"arrow"]];
    [bgView addSubview:arrowImg];
    
    [_icon mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_offset(15);
        make.size.equalTo(@(CGSizeMake(35, 35)));
        make.centerY.mas_offset(0);
    }];
    
    
 
    [_titleLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(weakSelf.icon.mas_right).offset(5);
        make.centerY.mas_offset(0);
        make.height.offset(20);
    }];
    
    [arrowImg mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_offset(-15);
        make.size.equalTo(@(CGSizeMake(20, 20)));
        make.centerY.mas_offset(0);
    }];
   
    
}

@end
